def get_user_input():
    try:
        height = float(input("请输入您的身高（米）： "))
        weight = float(input("请输入您的体重（千克）： "))
        return height, weight
    except ValueError:
        print("输入值无效，请输入数字。")
        return get_user_input()

def calculate_bmi(height, weight):
    bmi = weight / (height ** 2)
    return bmi

def interpret_bmi(bmi):
    if bmi < 18.5:
        return "体重过轻"
    elif 18.5 <= bmi < 24.9:
        return "健康体重"
    elif 25 <= bmi < 29.9:
        return "超重"
    else:
        return "肥胖"

def main():
    height, weight = get_user_input()
    bmi = calculate_bmi(height, weight)
    result = interpret_bmi(bmi)

    print(f"您的BMI指数为： {bmi:.2f}")
    print(f"您的体重状态： {result}")

if __name__ == "__main__":
    main()